Skip to content

try_to_load_from_cache returns cached non-existence#1039

Merged
sgugger merged 1 commit intomainfrom
Load_cache_alignment
Sep 9, 2022
Merged

try_to_load_from_cache returns cached non-existence#1039
sgugger merged 1 commit intomainfrom
Load_cache_alignment

Conversation

@sgugger
Copy link
Copy Markdown
Contributor

@sgugger sgugger commented Sep 7, 2022

This PR aligns try_to_load_from_cache with its Transformers counterpart to return a special value when a file does not exist for a given repo/revision and that fact has been cached.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Sep 7, 2022

The documentation is not available anymore as the PR was closed or merged.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 7, 2022

Codecov Report

Merging #1039 (ba9ba24) into main (8e5f219) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
+ Coverage   83.01%   83.03%   +0.01%     
==========================================
  Files          36       36              
  Lines        3822     3825       +3     
==========================================
+ Hits         3173     3176       +3     
  Misses        649      649              
Impacted Files Coverage Δ
src/huggingface_hub/file_download.py 85.56% <100.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Wauplin
Copy link
Copy Markdown
Contributor

Wauplin commented Sep 8, 2022

(Note: related to huggingface/transformers#18871)

Copy link
Copy Markdown
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for taking care of the docstring and the tests.

@Wauplin
Copy link
Copy Markdown
Contributor

Wauplin commented Sep 8, 2022

Will fix #1033.

Copy link
Copy Markdown
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you for completing the docs!

@sgugger sgugger merged commit 0c7b7ef into main Sep 9, 2022
@sgugger sgugger deleted the Load_cache_alignment branch September 9, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants